{extend name="common@base" /}

{block name="head_extend"}
{/block}



{block name="title"}{$user->nickname}{/block}


{block name="body"}

<div class="container">

    <table class="table table-hover">
        <thead>
            <tr>
                <th>银行卡号</th>
                <th>金额</th>
                <th>时间</th>
                <th>备注</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>

        {if condition="isset($accbook)"}
        {volist name="accbook" id="acc"}
        <tr>
            <td>{$acc->getBankList->name}-{$acc->getBankList->card_number}</td>
            <td>{$acc->amount}</td>
            <td>{$acc->createTime}</td>
            <td>{$acc->remark}</td>
            <td><a href="" class="btn btn-info">修改</a><a class="btn btn-danger del" data-target="#myModal" data-toggle="modal" data-whatever="{$acc->id}">删除</a></td>
        </tr>
        {/volist}
        {/if}

        </tbody>
    </table>
</div>


<div class="modal fade" id="myModal">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">

            <!-- 模态框头部 -->
            <div class="modal-header">
                <h4 class="modal-title text-danger">删除警告</h4>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>

            <!-- 模态框主体 -->
            <div class="modal-body">
                您即将删除此文章，是否同意。
            </div>

            <!-- 模态框底部 -->

            <div class="modal-footer">
                <a id="agree" class="btn btn-success">是</a>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">否</button>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.del').on('click',function () {
            $('#myModal').on('show.bs.modal', function (event) {
                var button = $(event.relatedTarget) // Button that triggered the modal
                var recipient = button.data('whatever') // Extract info from data-* attributes
                // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
                // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
                var modal = $(this)
                modal.find('#agree').attr('href','{$_form.account_book_del}'+recipient);
            })
        });
    });
</script>
{/block}